<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreateOpenShopSiteLocationHouseEvaluateTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('open_shop_site_location_house_evaluate', function (Blueprint $table) {
            $table->id();
            $table->string('orderNo', 64)->default('')->comment('房源orderNo');
            $table->unsignedSmallInteger('scenicScore')->default(0)->comment('景区评估');
            $table->unsignedSmallInteger('streetScore')->default(0)->comment('商街评估');
            $table->unsignedSmallInteger('shopScore')->default(0)->comment('铺位评估');
            $table->unsignedSmallInteger('takeoutScore')->default(0)->comment('外卖评估');
            $table->unsignedTinyInteger('rentGrade')->default(0)->comment('房租性价比 1高 2中 3低');
            $table->text('content')->default('')->comment('评估总结');

            $table->unsignedInteger('createdAt')->default(0)->comment('创建时间');
            $table->unsignedInteger('createdByUid')->default(0)->comment('创建人');
            $table->unsignedInteger('updatedAt')->default(0)->comment('修改时间');
            $table->unsignedInteger('updatedByUid')->default(0)->comment('修改人');
            $table->collation = 'utf8mb4_general_ci';
            $table->comment = '选址 - 房源评估';

            $table->index('orderNo', 'idx_orderNo');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('open_shop_site_location_house_evaluate');
    }
}
